<template>
  <div class="roo-header">
    <h4>入库人：</h4>
    <span class="rooh-info">{{ props.data?.commonOpt?.stockUserName ?? '-' }}</span>
    <h4>预计出库时间：</h4>
    <span class="rooh-info">{{ props.data?.commonOpt?.cautionTime ?? '无' }}</span>
  </div>
  <SuperTable
    ref="superTableRef"
    border
    height="600"
    :search="false"
    :pager="false"
    :show-card-header="false"
    align="center"
    :columns="columns"
    :data-request="fetchData"
    :scroll-y="{}"
    :export-config="{}"
    :toolbar="{}"
  />
</template>

<script setup lang="ts">
import SuperTable from '@/framework/components/core/super-table/super-table.vue';
import { baseColumns } from './columns';
import { TableColumnItem } from '@/modules/smart-reminders/pages/record-of-operations/columns';
import { ref, watch } from 'vue';

/**
 * const
 */
const props = defineProps<{
  data: any;
}>();
watch(
  () => props.data,
  () => {
    refreshTableFn();
  },
);
const superTableRef = ref<InstanceType<typeof SuperTable>>();
const columns: TableColumnItem[] = baseColumns;

const fetchData = async () => {
  return {
    data: props.data.details,
    pageIndex: 1,
    pageSize: 1000000,
    total: 10000000,
  };
};
const refreshTableFn = () => {
  superTableRef.value?.refreshTable();
};
</script>

<style scoped lang="less"></style>
